Clean up data correctly in deactivate

This fixes a bug that typos break subsequent completions.
Merge pull request #46 from yaotti/clean-up-data-correctly

Clean up data correctly in deactivatioin