Improved debug info for invalid header lengths