fix clobbering of type var. Closes #2