Fixed NullPointerException on disconnect.