Fix java checker crash, some memory leaks
Fix many memory leaks.