Fixes for GitHub issues #11 and #12