Fix deprecation warnings from JuliaLang/julia#8578