Fix for GLI
Fix infinite loop
Merge pull request #200 from philwebb/fix

Fix infinite loop and GLI-2 upgrade