Change binary heap to same logic order as used elsewhere

Fix priority queue to comply with new binary heap sort logic
Fix heap sort to comply with new binary heap sort logic