Fixed the binary heap implementation.