Properly cleanup after client disconnects

Change-Id: Ic4d34870669d8e05816ba0b5b65be89c7e5a19e2