Correct formatting of custom error responses.

Closes #34