Fixed spawn bugs.