Aiaprep tests and fix