Bug fix - Apply templates while there are unsaved changes