Fixed bugs which prevented Server and client from reading data