Use non-deprecated functions

They are better, and prevent error notices.