Fix nextSize prevSize and row/column identification