Bugfixed the resetting of the shared memory, prevoiously it would memset the whole shared memory, overwriting other fields, now only resets appropiate fields