Fixed the wrong "duplicated header" fatal error.

Fixed by properly localizing the variable.