diff --git a/modules/thejit_forcedirected/thejit_forcedirected.module b/modules/thejit_forcedirected/thejit_forcedirected.module
index dd3068a..e5a7024 100755
--- a/modules/thejit_forcedirected/thejit_forcedirected.module
+++ b/modules/thejit_forcedirected/thejit_forcedirected.module
@@ -296,14 +296,14 @@ function thejit_forcedirected_graph_to_forcedirected($graph_in) {
   $graph = array();
   foreach ($graph_in as $id => $data) {
     $name = $graph_in[$id]['data']['title'];
-    $node = thejit_forcedirected_create_node($graph, $id, $name);
+    $node = thejit_forcedirected_create_node($graph, (string) $id, $name);
     $node->data->{'$dim'} = 10;
     $node->data->{'$color'} = isset($data['data']['background-color']) ? $data['data']['background-color'] : 'white';
   }
   foreach ($graph_in as $from => $data) {
     foreach ($graph_in[$from]['edges'] as $to => $data) {
       // we flip from/to as thejit draws the arrow reverse
-      $adj = thejit_forcedirected_create_adjacency($graph, $from, $to);
+      $adj = thejit_forcedirected_create_adjacency($graph, (string) $from, (string) $to);
       $adj->data->{'$type'} = 'arrow';
     }
   }
diff --git a/modules/thejit_spacetree/thejit_spacetree.module b/modules/thejit_spacetree/thejit_spacetree.module
index 9e163e4..1ebfb87 100755
--- a/modules/thejit_spacetree/thejit_spacetree.module
+++ b/modules/thejit_spacetree/thejit_spacetree.module
@@ -401,9 +401,9 @@ function thejit_spacetree_graph_to_tree($graph, $config = array()) {
     }
   }
   $tree = new stdClass;
-  $tree->id = $root;
+  $tree->id = (string) $root;
   // the ID within the graph
-  $tree->graphID = $root;
+  $tree->graphID = (string) $root;
   $tree->name = $graph[$root]['data']['title'];
   $tree->data = new stdClass;
   $tree->children = array();
