[BUGFIX] Incorrect ifelse and logic operators