Fix for nested objects where some do not have primary keys

@tgoyne