Further code improvements to binary heap and map representation.

Signed-off-by: Nigel <Nigel@10.203.4.182>