fixed small bug with template compiling