Coverity complains that a negative value of best_v might be passed to record_qr_grid(). Fix supplied by Harald Eilertsen (http://github.com/snake66/).