Check if the current header is a valid one.

Fixes #1.
Merge pull request #2 from IonicaBizau/patch-1

Check if the current header is a valid one.