Fixed issue where NULL was being added as a node