Add some more basic tests revealing issue #19
Fix issues #18 and #20.