bugfix for nested attributes with their own IDs

This attempts to fix issue #20