Fix deprecated uses

These deprecated uses cause crash in applications