fix header double send, fix indent and docs