Automatic fixing of errors