Does B1 = 0 or "" initially? Can you change your formula to
=if(b1="",a1,IF(b1>a1,b1,a1))