Updates to fix extra space problem in error response codes

David, please merge - looks good to me!