Fixed issue #26.  Should probably write further tests for this.
Merge pull request #27 from txstate/master

Quick fix for issue #26