Fixed bug where n_bad_charges would never be reset