Correction for null rows in the mapping matrix