Fixed a bug with indexing in the atomic arrays.