More robust error checking. Make sure the modules run correctly, set the appropriate status.  Also check how many distance calculations are done.