Bug fixes and updates for compatibility with new lib versions

Java reflection usage had a bug, JUnit cases needed updating, node.js
command line usage needed updating, generic type usage needed fixing.