Fixed template code