Fixed stdev_r calculation

Now calculated with distance instead of magnitude to be consistent with Matt's paper.