Fixed incorrect flag spawning check