Java: minor fixes