Fixed minor array indexing issue