Fix order of correcting

So we correct them in order of dependence.