Fix issue #365 - crash on min/max saving