Fixed errors caused by changes in API.