Fixed issues caused by change in the API