Correct and cleanup code.