Replaced deprecated code.

@justintadlock Please review and merge the pull request.