BS-6600
Fix index array out of bounds