diff --git a/sites/all/modules/openlayers_proximity/openlayers_proximity.module b/sites/all/modules/openlayers_proximity/openlayers_proximity.module
index 2aa6e73..4f297bb 100644
--- a/sites/all/modules/openlayers_proximity/openlayers_proximity.module
+++ b/sites/all/modules/openlayers_proximity/openlayers_proximity.module
@@ -95,6 +95,7 @@ function openlayers_proximity_views_data() {
       'handler' => 'openlayers_proximity_handler_field',
       'click sortable' => TRUE,
     ),
+    'real field' => 'nid',
   );
   return $data;
 }
diff --git a/sites/all/modules/openlayers_proximity/views/openlayers_proximity_handler_field.inc b/sites/all/modules/openlayers_proximity/views/openlayers_proximity_handler_field.inc
index cc4c56e..8e9c662 100644
--- a/sites/all/modules/openlayers_proximity/views/openlayers_proximity_handler_field.inc
+++ b/sites/all/modules/openlayers_proximity/views/openlayers_proximity_handler_field.inc
@@ -37,7 +37,11 @@ class openlayers_proximity_handler_field extends views_handler_field_numeric {
   function query() {
     $handler = $this->view->display_handler->get_handler('filter', $this->options['location_provider']);
     if ($handler && $handler->value['location'] && isset($this->query->table_queue[$handler->table_formula_alias()])) {
-      $this->field_alias = $this->query->add_field($handler->table_formula_alias(), $this->real_field);
+      $this->field_alias = $this->query->add_field($handler->table_formula_alias(), $this->field);
+    }
+    // Fallback to avoid an "openlayers_proximity.distance unknown" field
+    else {
+      parent::query();
     }
   }
 
