Most legislative bodies have what is commonly called a "Law Review Commission" which is the main body that fulfills the "bug fixing" role you identify. I spent a summer working for one associated with the Michigan State legislature.
A law review commission is charged with identifying "bugs" in the law and suggesting fixes for them. But, generally speaking, they are woefully understaffed to handle this task in any comprehensive manner.
For example, in Michigan in the early 1990s, the Law Review Commission was led by a law professor who devoted perhaps 200 hours a year to the job in exchange for a small stipend, who coordinated the efforts of perhaps a dozen volunteer commission members who devoted perhaps 50 hours a year to the job, and a couple of law student interns who worked mostly in the summer for perhaps 300 hours a year each. This was a total of about 1400 person-hours a year, almost half unpaid, with almost no other budget except use of the law school's existing Westlaw subscription for the professor and the interns, and funds to print its annual report. The commission had no office space of its own, but used conference rooms at the law school to hold meetings for free.
The end product of the commission's work each year was an annual report distributed to legislators on the committees of the state house and state senate with jurisdiction over the Law Review Commission that would usually address perhaps half a dozen technical defects in the laws on the books.
Needless to say, this is completely inadequate to capture even a tiny share of the flaws in existing legislation known to members of the executive branch, or even the flaws that judges specifically address as requiring remedies in court opinions (although sometimes judges would send us courtesy copies of their opinions identifying legislative problems in hope of securing legislative action through proper channels).
The reality is that "bug fixing" legislation comes almost entirely from the initiatives of chief political relations officials in government departments (who go by myriad titles), from an Ombudsman in governments that have them (e.g. the U.S. Taxpayer Advocate), from the personal initiative of elected officials and their small legislative staffs (a fairly small subset of their total staffs), from bar association committees, from the work of various "think tanks", from a handful of highly sophisticated and politically savvy constituents who communicate recommendations to legislators whom they know, and from lobbyists, on a fairly ad hoc basis. Sometimes a state auditor or the General Accountability Office at the federal level, will also make recommendations.
This answer is based primarily on my personal experience working for a Law Review Commission in law school, as a staff member for a Congressman as an undergraduate, and as a law partner of a state legislator in my professional life including discussions with visiting legislators from other countries participating in exchange programs.