-- fixed some bugs in the adi schema