Fixed compatibility with Ruby 2.0

Was relying on a byte string automatically being converted into a
numeric, now do it explicitly.