Added tests for Map as a source, and fixed a couple of bugs