Java backend: minor fixes