bug 1670918: fix more size and count validation bugs
bug 1670918: fix more size and count validation bugs

This fixes another size validation bug with matching. This also fixes
the count validation in a similar way.

mozilla-services/tecken,mozilla-services/tecken,mozilla-services/tecken,mozilla-services/tecken