Fix error in template compiler