Fix regressions in aiaprep merge