Don't use outdated methods

This fixes #1362.
Merge pull request #1512 from perlun/patch-9

Don't use outdated methods