Correcting a paper that just came back from review, what should I do?
If you can justify the changes, there's no problem with making them. The first error for example should be clearly acceptable, if you said you performed error analysis in this way and it turned out there's a bug in your code.

The second is more dicey. Superficially, it might seem like you're altering your data because you have an outlier point (ergo, it's confirmation bias). You will need a convincing explanation why the new data set is better than the old one, why the outlier should not matter, etc.

In any case, if you make these kind of unsolicited changes, do be clear about them in your response to reviewers / cover letter. Otherwise, reviewers would have to read the entire paper again.