Fixed type check errors in jvm library

related to issue #633