Fix nested item overwriting.

Fixes #11.