Fix a redirect loop

In some cases, applied was true while the URL wasn't actually changed.