Fixed a bug with matching
Fixed another bug in matching