Fix bug on type checking when assigning a value to an existing variable.