Fix a bug in teleportation.