implement equals for MapNode, fix related bugs, remove dead code