Fix a typo on array index, related to ticket #3963