added prefix matching, fixing up the chat utils
fixed a couple of bugs