Carpeting ripped off stairs revealed gaps on both sides of the risers and treads where the carpet once wrapped around. These gaps were filled with foam gap filler, the kind used to insulate openings up to 1” from drafts. Then the filler was wiped down to just below the top since it dries solid. After it had dried, sand-able, paintable spackle was used on top of the foam sealant and allowed to dry. Once touched up with paint, the gaps disappeared.