Make sure kv rules are applied before using vars.