Fixed scope compilation issues with latest gcc