fixed NPE in ModelASTTransformation
messed around with optimizing early returns