Prevent faults when adding/removing layers to/from the map with the selectionmodule. Possible fix for #96