Fixes to #4
Merge pull request #5 from include-x/master

Missing code for #4