Fixed bug where sample count was computed incorrectly.
Fixed bug where sample count was computed incorrectly.

Thanks to charliea@ for reporting it.

aschulm/battor,aschulm/battor,aschulm/battor,aschulm/battor