Fix the instantation of templated rules