Essays in credit portfolio management