Merge the two spawn calculation fixes