Fixed a few bugs.
Merge branch 'Delete-error'