Improve dimension teleport stability. Fixes #1160.