Reset the template when converting a doctype and the new doctype does not have a template assigned

Fixes U4-5848
Merge pull request #550 from tompipe/umbukfest-U4-5848

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