Fixed two bugs: unquote urls and better extraction of root dir