Fixing headers to be more independent and fixing a few bugs along the wa...

...y.