Fix compareTo function for intenger