Adapt for API changes

Change-Id: Iba8a4999294e799aab7137221f06a0c957bca82f