Changed url dependency to native node module. Improved basePath comparison.