Fix some edge cases in URL computation for the Redirect and Popup auth drivers.