Replace deprecated API usage.