Clean up and fix lots of deprecated bits