Fixed infinite loop: Github issue 104.
Merge pull request #112 from gordonkristan/pull_request

Fixed infinite loop: Github issue 104.