Update failing checks flag only if there was a change

Otherwise we just waste resources on checking that there is no change.
Wrap long line
Centralize path cache handling