Update code for the removal of Pen.undo().
Fix a bug in typesetting different height lines.