Fixed a bug that would delete text

Remove a load of code that tried to be clever about removing padding
characters at the end of a run of zcharacters, but basically just broke
things occasionally.