Minor java compatibility fixes