Fixing: memstream crash