Fix template references.