Fix memory leak.
Fix integer overflow.
Fix memory leak with linked spawn points.