Fix alias lookup return codes. Closes #3356