bugfix: protect against division by zero in the "check leak" testing mode.