Fixed bug in SharedMemoryOutputStream