fix an off-by-one in the match array length