Cleaned up test
Make sure toMap does not include unset values
Allow DISTINCT to use existing registers