Make sure a match doesn't extend beyond a single record.

Fixes #4