Added some tests and fixed a couple of bugs related to the creation o
the map