Turned shared_ptr<SemanticAnalysis> into SemanticAnalysis& and fixed #24