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

Fix deprecation warnings