Registration redirect not working after an unsuccessful registration attempt

What was happening was that, after a failed registration a null $redirect variable was being passed to the ViewModel. This was because $redirect variable was set from the get query which didn't exist after the pgr, instead the redirect url should have been set from the prg array if set.