} else {
$sql_data_array = array('customers_firstname' => $firstname,
'customers_lastname' => $lastname,
'customers_email_address' => $email_address,
'customers_telephone' => $telephone,
'customers_fax' => $fax,
'customers_newsletter' => $newsletter,
// 'customers_password' => crypt_password($password),
'customers_password' => $password,
'customers_default_address_id' => 1);
if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;
if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = tep_date_raw($dob);
tep_db_perform(TABLE_CUSTOMERS, $sql_data_array);
$customer_id = tep_db_insert_id();
$sql_data_array = array('customers_id' => $customer_id,
//cchange line below to suit your version
//'address_book_id' => 1, //pre MS2
'address_book_id' => (int)$default_address_id, //for MS2
'entry_firstname' => $firstname,
'entry_lastname' => $lastname,
'entry_street_address' => $street_address,
'entry_postcode' => $postcode,
'entry_city' => $city,
'entry_country_id' => $country);[/b]
if (ACCOUNT_GENDER == 'true') $sql_data_array['entry_gender'] = $gender;
two times ... ?? maybe there is your failure