Fix tests and remove unused files.