Added more tracking functions and unittests.