Make it compile on clang and fix typedef