Fixed some serious problems with unit cell and distance calculators.  Should work smoothly now.