Adverse Selection, Moral Hazard and the Term Structure of Default