Make sure headers are properly protected, close #1154