Fixing deprecated functions.