compatibility fixes for java