Fix deprecated functions warnings