Minor tweaks & cleanup to Java code