Fix deprecation problems