--- entityreference_prepopulate/entityreference_prepopulate.module	2012-09-17 14:44:13.000000000 +0200
+++ /home/nand/Code/drupal-7.16/sites/all/modules/entityreference_prepopulate/entityreference_prepopulate.module	2012-11-05 19:16:30.861920827 +0100
@@ -97,10 +97,11 @@
     return;
   }
 
+  $inside_ajax = FALSE;
   if (!empty($form_state['triggering_element']['#ajax'])) {
     // We are inside AJAX, so values can't be taken from URL at the
     // moment.
-    return;
+    $inside_ajax = TRUE;
   }
 
   // Check if there is a field that needs to be prepopulated attached to the
@@ -130,7 +131,11 @@
       }
 
       $field = $value['field'];
-      if (entityreference_prepopulate_get_values_from_url($field, $instance)) {
+      // If we are inside ajax and a previous default value was set via the $_GET argument, 
+      // or we are building the initial form, and the $_GET argument have values
+      if (($inside_ajax && 
+          empty($form_state['complete form'][$field_name][$lang][0]['target_id']['#default_value']) == false) ||
+          entityreference_prepopulate_get_values_from_url($field, $instance)) {
         if ($settings['action'] == 'disable') {
           $form[$field_name][$lang]['#disabled'] = TRUE;
         }
@@ -140,7 +145,7 @@
           $form[$field_name]['#access'] = FALSE;
         }
       }
-      elseif (in_array($settings['fallback'], array('form_error', 'redirect'))) {
+      elseif ($inside_ajax == false && in_array($settings['fallback'], array('form_error', 'redirect'))) {
         $message = t('Field @label must be populated via URL', array('@label' => $instance['label']));
         if ($settings['fallback'] == 'form_error') {
           form_error($form, $message);
