BZ-1013960: fixing support to the use of ternary expressions in variable replacements