Fixed possible integer overflow in quality plots