Fix the use of deprecated functions