Fixing bugs on glbal header reference