Fix a bug where we never reconnect. Probably possible to clean this up a little.