heap.js insert: fixed array references and scoring