Config saving, NPE fix, msg system cleanup.

Lots of stuff..