Fixed infinite spawning loop.