Replaced calls to deprecated methods.