Fix unit test compilation errors with gcc -O[23]