Addressed more comments on the pull request. Fixed a bug when the condition is defined by a bound variable.