changes to use an ordinary map with pointers instead of AssociationMap
fix up runtime errors