Fixed a bug relating to the logic for resolving paths.
Fixes an issue where previously a project xyz could sometimes be
returned instead of a project xyz_abc because they share a common start
string.