Fix stack overflow with teleportation