fixes bug that didn't bind a variable in the environment in a case analysis