Fix use of deprecated functions.