Fixing bugs inside scripts