Fixed issues with newly introduced C-API.