Fix up some more issues, replace spinlock with atomic fetch_and_add