Fixed issues with teleporting to/from the end