Added tests for tracker functionality. Corrected a number of issues.