Fix compat issues with java