Null guard to avoid NPE, MPS-17910
Recursion guard for typechecking, MPS-20239
Merge remote-tracking branch 'origin/MPS3.1'
Made required solution