Let's keep body_length use here, but I rearranged the clauses, putting {undefined, _} first, and the second one {Length, _} when Length > MaxBodyLength -> will match empty or non-numbers.