diff --git a/nodewords_extra/nodewords_extra.module b/nodewords_extra/nodewords_extra.module
index 3dfd35a..6938abf 100644
--- a/nodewords_extra/nodewords_extra.module
+++ b/nodewords_extra/nodewords_extra.module
@@ -125,8 +125,10 @@ function nodewords_extra_nodewords_tags_info() {
       'label' => t('Location'),
       'permission' => 'edit location meta tag',
       'templates' => array(
-        'geo.position' => NODEWORDS_META,
-        'icbm' => NODEWORDS_META,
+        'head' => array(
+          'geo.position' => NODEWORDS_META,
+          'icbm' => NODEWORDS_META,
+        ),
       ),
     ),
     'shorturl' => array(
@@ -440,24 +442,32 @@ function nodewords_extra_location_form_validate($element, &$form_state) {
  * Set the meta tag content.
  */
 function nodewords_extra_location_prepare(&$tags, $content, $options) {
-  if (empty($content['latitude']) || empty($content['longitude'])) {
-    $content['latitude'] = !empty($options['default']['location']['latitude']) ? $options['default']['location']['latitude'] : '';
-    $content['longitude'] = !empty($options['default']['location']['longitude']) ? $options['default']['location']['longitude'] : '';
+  // Load the defaults if at one or more of the lat/long values is invalid.
+  if (!isset($content['latitude']) || !is_numeric($content['latitude']) || !isset($content['longitude']) || !is_numeric($content['longitude'])) {
+    if (isset($options['default']['location']['latitude']) && is_numeric($options['default']['location']['latitude']) && isset($options['default']['location']['longitude']) && is_numeric($options['default']['location']['longitude'])) {
+      $content['latitude'] = $options['default']['location']['latitude'];
+      $content['longitude'] = $options['default']['location']['longitude'];
+    }
   }
 
-  if (!empty($content['latitude']) && !empty($content['longitude'])) {
+  // Compile the output tag.
+  if (isset($content['latitude']) && is_numeric($content['latitude']) && isset($content['longitude']) && is_numeric($content['longitude'])) {
     $tags['location:geo.position'] = $content['latitude'] . ';' . $content['longitude'];
     $tags['location:icbm'] = $content['latitude'] . ',' . $content['longitude'];
   }
 
+  // Optional Location.module integration.
+  // @TODO: Shouldn't this override existing data, rather than only be used if
+  // nothing was previously set?
   $bool = (
     empty($tags['location:geo.position']) &&
     $options['type'] == NODEWORDS_TYPE_NODE &&
     module_exists('location') &&
-    ($node = node_load($options['id']))
+    ($node = node_load($options['id'])) &&
+    isset($node->locations[0]['latitude']) && is_numeric($node->locations[0]['latitude']) &&
+    isset($node->locations[0]['longitude']) && is_numeric($node->locations[0]['longitude'])
   );
-
-  if ($bool && isset($node->locations[0]['latitude']) && isset($node->locations[0]['longitude'])) {
+  if ($bool) {
     $tags['location:geo.position'] = $node->locations[0]['latitude'] . ';' . $node->locations[0]['longitude'];
     $tags['location:icbm'] = $node->locations[0]['latitude'] . ',' . $node->locations[0]['longitude'];
   }
