Fix bug with conditions