add some missing 'keep' statements
rearrange the protections for missing collections