Added null check to chat_add_line to prevent seg faults. Made the exit to menu cleanly shutdown network.