Fixed compile issues (using C functions in C++)