Fix the bug in Heap Sort