Dereference pointers correctly for qsort()