Make sure only to assign only keys that are available.

By applying the available scope first, we include constraints such as
the void flag, which was being ignored.