Fixed matching function.