Fixed incorrect URL when there were no query strings (#757)