Fixed template loading bug