vt7.1 - vtlib FieldBasic.php does not define $headerfield so it cannot be set
When you create a field using vtlib there is no var $headerfield defined as part of the Vtiger_FieldBasic - this means that when creating the field it sets the value of headerfield to null in the vtiger_field table, and you have to manually set the headerfield value in CRM settings.