Merged in improved shared_memory management.