Fix frame switching after frame redirect/creation (follow on)

Continuation of #1177.

@mrmr1993:  I did some tidy up of #1177.  Could you double check, please, and also check the comment (which I will make in a few moments) below?