Fixed js bug when deleting map.
Fixed small bug related to previous refactoring
Fixed #21, added map name detection