fix some bugs in Java compiler