Made a few fixes to spawn_system.lua and moved the test function to setup.lua.