Handle optional relation name properly.