Fix deprecation warnings
Merge pull request #403 from ebfe/deprecation

Fix deprecation warnings