We had several places in templates where booleans weren't
handled correctly - if the boolean was defined, the template
conditional would be true regardless of its value. Fix these
conditionals so they have the correct result when variables
are defined but false.
Change-Id: I2c8e0b8ac72b5a132b0d3e1f4f0e399454397873