Fix typo that could cause an infinite loop when tunnelling.

Thanks to xnoreq for the extensive debugging session.