Remove dead files, fix test cases.