Fix var name for legacy templates