Updated API calls to non-deprecated methods.