Fix JOINs that have ORDER BY rand()