Fixed issue regarding java auto casting a division to int