Checking modulo of negative numbers