[BUGFIX] Fix path resolution

Fixes path resolution when both TS and register method are used.

This patch is a backport from development. Re-merging, this may cause troubles.
Merge pull request #142 from cedricziel/pathFix

[BUGFIX] Fix path resolution