Working out corner cases for decoder and tests