Fixes node.js errors

usage under node.js with my bad javascript objects enlights these errors in error detection code :-)