Fix some Java quality flaws