Added increment code for _idx.