Fix the content type header not being set. Fix a panic. Where we were expecting an output type, but didn't actually have one.