Second attempt at fixing ncols counting bug