Fixed copying too much into local headers.

Reported by Sea Caspian (j.sea.caspian [at] gmail.com)