Fixes for java