Fixed infinite loop
Merge branch 'master' into demo