Added additional debugging logging for length header