Add tests for tm util functions.