Fix (most) warnings in Java backend