Fix logicals conditions