Better handling of min, max, restore