Fix deprecation warnings
Merge pull request #444 from ebfe/fix-deprecation

Fix deprecation warnings