fixed small "NICK_ALREADY_IN_USE" bug on kill/quit events and tidied up code style