Fix invalid metadata on delete.
Refactoring.
Merge pull request #6 from nbeloglazov/fix-meta-on-delete

Fix meta on delete
Release 1.1.2 to include bugfix from #6.