Fix magn2311 Error disappear after any valid operation which was not related to error node.

- Instead of clearing all warnings for each execution, only clear warnings that associated to an expression when the expression is going to be executed again. 
- Minor code cleanup.