Various improvements to conform better with the Java platform