fixing problems produced during re-factoring