Fix bugs, account for redundant headers