Fix for issue 7211, template replaced