Fix error response handling

For some reason, it assumes the body of any error will be on one line.