Fix occasional test breakage due to badly-encoded bytes.