IDisposable and little changes

I implement IDisposable interface for client classes and also introduced
minor changes in server.