Wait modal for test unsetting

Fixes several problems; see commit list for breakdown (and to review separately).