Fixed multiple foreign keys and array accesses