Ensure alias resolution is bottom-up and recursive, add a test