In general, when fixing a bug like this it's good to think of the most non-invasive, surgical way to fix it, then to consider doing broader re-factoring.