Fix URL parsing bug for remote URL