Fix deprecation errors