Added a regression test and fix for github issue #83. Fixes #83.
Fixed a memory leak identified by valgrind.
Added test file for regression test.
Moved free to avoid a double free error when the user supplies an
invalid operator.
Merge pull request #84 from keithj/devel

Added a regression test and fix for github issue #83. Fixes #83.