Improved disconnect and deserialisation error handling