Unsure to_int rejects negative numbers

Also corrected some mistakes in to_int code.
There were 2 overflow checks, so I deleted the second one.