remove unneeded to_i
better error messages