Fix autowidth in combination with sanitizing

By only sanitizing just before serialisation.

This fixes issues with & and auto width (&amp; is used for the auto width calculation..)