Bug fixes to message saving