Fixed a condition in the buildHeap function.