Fixed infinite loop detection, I hope.
Merge branch 'master' into production