Fixes for stacked (eg. hybrid mask) session save/restore.