Fixes "canonical" name when multiple aliases are added.

This fixes the use case where multiple aliases are added to a known path where the "canonical" name was getting incorrectly truncated.

Unit test included.