Added unittests for some uncovered code.