Fix extra trailing slash bug

On mac, the resolve() function was adding a trailing slash.  Reorder
the substitutions to fix.