Fixed template compiling