fix remInteger
integer and arithmetic fixes