Fix bug in spawn.lua