Tak einto account for the border case
Minor: Test border case
Cython implementation of _heap.py