Fix bugs with "hot" template