Fix wrong key from $vars (closes #6375)