Fix clang issues, wrap most functions