Fix: Corruption during session write