remove unnecessary condition and coerce bool return #1263 #1264