fix argument indexing bug in fix ave/atom
(cherry picked from commit bc11518960b8454ae6f84c4620c8a391fc683f0b)