Improved spawn handling