Fixing up the magnitudes dumping code to work
with the kdtree branch.