Agency costs, risk management, and capital structure