Avoid divide by zero in rampslide spark code