Added handling of collections with keys and non-keys for access control.