Fixing some Java code