Fix several unit test issues.