Replaced all deprecated functions.