Fixes for JDK8 compliance (subtle differences for scripting)