Fix deprecation warnings, close #48