Revert 0.5.1 behavior and fix header bug