Fix boolean support for unless/onlyif

ea0c5cc attempted to implement the feature request in #6780, but did not
quite work. This commit properly implements the feature.