bug fixes

Fixed some crashes and incorrectly formatted messages