Addresses #1551, by adding a simple error check. I just copied the code from hero_api_teleport
(or a similar function). If that happens a lot I suppose we should put it into a helper function, but I have only worked with these two copies. I also added a test, which might be more precise than it has to be, but it does pass.