use signed lengths in parser and generator