Remove dead code.
Take care of some deprecated methods.