Minimizing errors, maximizing incentives: Optimal court decisions and the quality of evidence