Fix bug in RestClient