Fix deprecation warnings on heroku