Fix classcastexception from java.int to java.long