Fix template references