Misc utilities added to the java side; reduce warnings