Fix a heap of bugs in the auditing code. Reduce the scope of exception catching so fewer bugs are masked. Correctly set content-length header. Correct the audit matching path.