Fixed incorrect getindex usage