Correct errors that may occur