Fixes for gcc and clang