Java migration

Minor java fixes.