Fix out of bounds array