Fixed bug when editing items.
