Investment under Uncertainty and the Value of Real and Financial Flexibility