Move keyref processing to take place before conref processing #1631