Essays on costs and benefits of credit default swaps