Fixed infinite recursion and boolean expression