Made the script work with 0.4+ of weechat