Credit Risk and Real Investment Dynamics ∗