Fixed small bug in spawning.