Fix bug with decoding values larger than max int