Fixes for pull request #20