Fix two more places where relations as a function can go wrong.