Some modifications and fixes for adding clients