Fix bug where errors where not removed