Changed AtomicInt to Atomic template.