Fixed bug with AD tree indexes