improve check for r=0