Some cleanups following issue #19
Fixed issue #20