Fixing the bug in HeapSort Class