Fix patch matching