How can I stop a swept form coming partly out of the other part that is thin?

I am using a rib to connect two other features. The swept follows the path but a corner comes out the other side because the feature si thin and the path is on an angle. Then I have to trim that piece off with another cut. Is there a setting to stop the swept at the outside surface?

SolidworksParts And Features