Debug cleanup and header fixes.