Modified decode() to raise an exception when itext_offset is invalid