Tested and fixed bug in GitHub Issue #9