fixed some cases in [substitution_preserves_typing]