Check for an invalid count and report an error if found. This
prevents some segfaults when count goes negative.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
At high step speeds, it is possible to exit the inner scan due to
integer truncation. Always update minadd or maxadd so that the outer
loop always terminates.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>