Added tests, fixed some data map bugs