fix a out-of-bound bug

Signed-off-by: Sébastien Boisvert <boisvert@anl.gov>