lightirc: more bug fixes and cleanups