Ha, great point! For our own User-Visible Improvements goal we initially felt like it shouldn't count to fix a bug that we had only just created, since that's not exactly a net improvement. But then we decided that it's fine to count it, for exactly the reason you say.
We haven't gone quite so far as to count the actual creation of the bugs towards our goal though. :)