Fix logic for association metadata