Fixed mistake in array indexing