Fix SIGFPE crash

the minimal count and also min may stay at zero and then we divide by
zero causing a SIGFPE.

Closes #48