Fix template variable access deprecation