Fixed some prefix issues and flag spawning issues