Fixed template rerendering