Replace deprecated functions.