You seem to be setting SHARED_MEMORY_METADATA to $SHM_CONFIGURED in line 1264 and then overriding it here. Is that intended?