Fixes #455 - JavaScript to Java improvements