Bug fixes and flag teleport