Fixed cycle detection in expressions.