Fix deprecation warnings.
Merge pull request #136 from nwin/master

Fix deprecation warnings.