Hacky internal handling caused the counter of warning messages to be too high in error after summary tex file was written.