Fixed bugs of unit tests.