Fix bug when assigning variable

Previously, if a variable was assigned a value more than once both
values would exist in the environment.