AEI script fixes