Code fixes due to API changes.