Fixed a bug in Measure() method