Fix bad template variable references.