Fixing compile errors on GCC/Clang