Fix a bug in Item#_removeNamed() for items without parents.

Closes #490.