Fixes for issues #17, #19 and #20

The major fix was for issue #17. Issues #17 and #19 just tagged along
like the entourage they were…