Change root_path named route if namespace is nil

Fixes #2837