Fix cpg:leave so that error is a result, when appropriate.