Got spawning working again (although a few things need tidying up).