Fix build as well as most deprecation warnings