Modified distance flagging value.
Fixed bug in distace flagged values calculations.