fixed typo in C api, tested OK