Mask mode min-length session save/restore bugfix. See #845