Shared memory bugs fixed