Improvements mostly related to client-server usage

Well, this won't get invoked if an exception is thrown before.