Clear distance result before distance computation.

  - result is not clear in function call.
Merge remote-tracking branch 'origin/master'