Fixed some outof bounds exceptions in spawning