Fix compilation for gcc and clang. Fix test for gcc