Index: popups_reference.module
===================================================================
--- popups_reference.module	(revision 154)
+++ popups_reference.module	(working copy)
@@ -79,21 +79,21 @@
  * @param $item - the form element array.
  * @param $fields - all fields info.
  */
-function popups_reference_alter_item(&$form, $key, $item, $fields) {  
+function popups_reference_alter_item(&$form, $key, $item, $fields) {
   $field_name = strstr($key, 'field_'); // Check if $key starts with 'field_';
-  if (isset($fields[$field_name]) && 
+  if (isset($fields[$field_name]) &&
       $fields[$field_name]['type'] == 'nodereference' &&
       variable_get('popups_reference_show_add_link_'. $field_name, TRUE)) {
     $type = $form['type']['#value'];
     $field = content_fields($field_name, $type);
-    
+
     $wrapper_id = 'popups-reference-' . _popups_reference_counter();
     $links = _popups_reference_links($field, $type, $wrapper_id, $field['widget']['type']);
     if ($links) {
       // Put the nodereference widget and links in an wrapper.
       // Makes it easy to find for Ahah targeting, and popups_reference behavior selecting.
-      $form[$key]['#prefix'] = '<div id="'. $wrapper_id .'">';
-      $form[$key]['#suffix'] = '<div>Add New: ' . implode(', ', $links) .'</div></div>';
+      $form[$key]['#prefix'] = '<div id="'. $wrapper_id .'">' . $form[$key]['#prefix'];
+      $form[$key]['#suffix'] = $form[$key]['#suffix'] .'<div>Add New: ' . implode(', ', $links) .'</div></div>';
     }
   }
 }
