Updates to fix extra space problem in error response codes

David, do not merge. I will submit another pull request.