Fixed shared memory allocation.