Fix a compile error and a bunch of unit test issues.