Add defensive checks to Styliser.

Issue DMDirc/Plugins#47