Fix 'which xx' logic for aliases