Move some stuff that really belongs in JOIN.