Fixed a bug in leakage quantification