Replace deprecated methods.