Added a semantic check for the type of operations.