added changes from @hangarr nearinfinity/node-java issue #61