Add Scala version and some minor changes to Java version