Bug fix.

The exception/error handling in loop did not work, previously. Upon a
disconnection with the server, the bot would infinite loop. Now it correctly
terminates when there is a network issue.