Improve handling of atomic tasks