Made the code C ABI compatible, and possible some other changes.