Implements fix for bug where items are appended rather than replaced.

...an appending to them. Fixes #33.