Cleaned up msg_atomics code