Header guards and palette optimizations