Merge Marc's PR #6 that fixes issue #5, plus a few other tweaks that were waiting to be committed on my local source.