Merging some changes from upstream

Merging changes that have accumulated from upstream,
https://github.com/micolous/ircbots