Added match depth to support returning most significant error message