Fix use of deprecated functions.
Merge pull request #3 from ehuss/fix-deprecation

Fix use of deprecated functions.