Restructured path resolution to make it work better with web app.