fix recursion when versions app is enabled, returning '.'

Backport of e2a83b4b90386c7b4a9ede75e75f98516f387168 to prevent infinite
loops