Bug fix on disconnect.