Added several checks to ensure that the values read from the headers are consistent Reviewed-by: jrose