First changes to make it compatible with API 10