Fix progress bar div by zero

When self.max is zero, a div by zero error used to occur. This fixes it.