Fixed issue #7852: Cryptic error when survey is deactivated twice