fixed template linking errors