One of the modules I use in a website manually sets the menu item using menu_set_item(), the purpose is to make a node appear as though it is within a menu when it is not. When using this module, the NID returned on line 73...

$node = menu_get_object();

is the referenced NID and not the actual NID due to the fact that you are using the menu system to find it out. Is there a reason why you are using this method instead of ...?

  // Get the currently viewed node.
  if(arg(0) == "node" && is_numeric(arg(1)))
    $node = node_load(arg(1));

Thanks
Will Eaton