Fixed template linking behavior