Messaging fixes

Fixed a few mistakes in the last commit - silly stuff like naming the
file the wrong name, doing an assignment instead of checking, and
authentication setting the right stuff in the session.