script: Fix double borrow error when going back. Closes #4402.

I have verified that back and forward work once again.

Sorry about this one. r? @jdm