(PE-957) port `to_bool` logic over to match puppet's impl