Bugs and unintentional design deficiencies get zero story points at my job. It's actually something I fought for because it's faux-progress - it's work that's actually a part of the original (likely underestimated) story someone already earned points for.