Fix out of scope access when building with gcc 4.7