Fix error when editing item title (fixes #2)