Fix test failures, clean up imports.