resolves #335 fix bad variable name, add test for it