Fix remaining unit tests and compile errors.