Fixed wrong redirect_uri when popup is used