Replace 2 deprecated methods

Change-Id: I8e420f0259ef6c9e579f7a00beb58f28af9da37d