Sorry, I was completely going down the wrong road. to_i and to_int are different.