Update profile lookup code for API changes.