Minor java fixes