Fix alias lookup return codes. Closes #3356
Merge remote-tracking branch 'kali/bug/fix_return_codes' into develop