[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.