Fix heapsort