Fixed template issues