Fix implicit boolean conversion warnings