Clean up data correctly in deactivate

This fixes a bug that typos break subsequent completions.