Fix multiple warnings when compiling as C++