US to spend billions to fix flaws in nuclear program