Fix using extra 0 bytes when decoding input