Coding style fixes in distance functions.