Fix for destroying map causing error, and also destroy depend join models for map layers and my maps