Check if teleporter is instance of TravelAgent before casting. Fixes #1364