Implications of Renegotiation for Optimal Contract Flexibility and Investment