Fixed client.sh related bugs