Currently you can insert a phone record (for example) via API (and I think also via Profile) - and the is_primary flag is set to 0 even though it's the only phone record for that contact. This causes problems in the EDIT Contact UI (as well as other interfaces). We should ensure that is_primary is always set TRUE for all these objects if they are the only one for a contact.
EXAMPLE: Using the location_create API insert a phone number for a contact that does not yet have a phone record...
$workPhone =array('phone' => '02327276048',
'phone_type' => 'Phone');
$phones = array ($workPhone);
$workEmailFirst = array('email' => 'email@example.com');
$workEmailSecond = array('email' => 'firstname.lastname@example.org');
$emails = array($workEmailFirst,$workEmailSecond);
$params = array(
'phone' => $phones,
'city' => 'Mumbai',
'email' => $emails,
'contact_id' => $contactID,
'location_type_id' => 3
$locationAdd =& civicrm_location_add( $params );