Shm-wstate implementation improved.