Fix crash with badwords of type 'end' and possibly when messages contain only control codes. Also fix matching single words at the beginning of lines.