Fix some tests and remove unused references.