Added logout command.
Resolved unintended double hook on connect.