Fixed pubsub shutdown handling if not connected to server. Closes #7