Fixed errors on client disconnect.