bug fixes in the RestClient