lucky someone wrote very readable sourcecode so these fixes were a diddle