Reverting messaging system to old code that works and other small changes