A bunch of small fixes to make compilation work on Clang