tighten up message parser
small fixes to various bits