Math plugin fix + multiple IRC channels

Please merge this feature if it is needed in upstream.