Fixes issue #895

Spatial constraint not being cleared when all layers are removed.