fix NPE (seems to appear on model reload)
fix MPS-19621 Optimize imports on a model removes references to necessary models