more robust String#to_i patch