checkout header values for out-of-bounds
fixing compiler warnings
fix compiler warnings