Fix bug where attribute[key] is nil.

Resolves an error if the value is an array of empty hash.