Finally fixed the bugs to do with remove_client. I was using create_client by accident- ruining the internal representation of the clients.