Reset the template when converting a doctype and the new doctype does no...

...t have a template assigned

Fixes U4-5848