Fix issues running under JVM.