Modified client study code, and fixed basic server clean up process.