VE-742 Fix logic for several conditions