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

Fix deprecation warnings