Fixed template loading problem