Replace deprecated methods.
Merge pull request #1712 from dereuromark/master-deprecated

Replace deprecated methods.