Fix regressions in aiaprep merge
Merge pull request #1058 from Cadair/master

Fix regressions in aiaprep merge