Fixed a bug with deletion.