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.
Merge pull request #2 from imalberto/fix-nameorder

Fixes "canonical" name when multiple aliases are added.