Correcting event numbers to be in correct range