Fixed issues with exceptions on client close.