Fixed a bug with updating the matches slice so that the number of matches is consistent