Replace deprecated function.