Fix typo.
speed up distance calculation
add ref to LGPL