dup object passed into block before appending it to parts

This fixes #571. See issue for full details of what the actual bug is.