Remove dead code and clear warnings.