Unittest

Two fixes for unittest.