Fixed decoding to use correct size integers.