Fix bug in sortAscending when referencing index proeprty