Several minor fixes for client and examples