Fix session serialization