Fix deprecate warnings