By the end of the fourth inning in the first game of Maryland softball’s doubleheader Saturday, Penn State had plated eight unearned runs to open up a commanding 8-1 lead.

Two errors by the Terps in the fourth had provided the Nittany Lions extra opportunities and baserunners, and they took advantage to put the game away with a 12-1 win.

Maryland fell once again in the nightcap, 9-3, and entered Sunday with a desperate need for improvement on both sides of the ball if it wanted to avoid a sweep at home.

After committing five errors in two games Saturday, the Terps found their footing in the field and at the plate Sunday with no errors and five runs in two innings en route to a 5-4 win. Maryland held off a late Nittany Lions comeback, avoiding the sweep through a much-improved defensive effort.

“Truthfully, we did not play well [Saturday],” coach Julie Wright said. “The team acknowledged that, and they knew they were in a situation [Sunday] where they needed a win.”

[Read more: Maryland softball holds off Penn State, 5-4, to avoid sweep]

In Saturday’s first matchup, defensive miscues plagued the Terps from the start. On the first play of the game, an error from first baseman Taylor Wilson put Penn State left fielder Toni Polk on base, and she was later driven in for the first run of the game.

The second inning followed a similar sequence. After Sydney Golden struck out her first batter, center fielder Dani Fey hit a fly ball right to center fielder JoJo McRae, who misjudged the hit as it sailed over her glove for the team’s second error. Fey scored just two batters later to put her team up 3-1.

And in the fourth inning, the Nittany Lions took command with help from two more Maryland errors, one from catcher Gracie Voulgaris and another from second baseman Bailey Boyd. The Terps served up four errors to Penn State in game one, and right-hander Sydney Golden exited the game in the fourth inning with no earned runs to her name, her team trailing 5-1.

“We just didn’t bring it defensively,” Wright said, “and you just cannot have that many errors and expect to win a ball game.”

Both teams had an error each in Saturday’s second game, with Maryland coming in the middle of the Nittany Lions’ four-run first inning. But even though the Terps’ defense cleaned up its fielding, the offense couldn’t rally from an early six-run deficit.

On Sunday, Maryland was determined to play an errorless game after Saturday’s struggles, providing its pitchers little room for error on the mound.

“We wanted to come out stronger on the first pitch,” shortstop Bailey Boyd said, “and we really wanted to play a clean game for our pitchers.”

[Read more: Penn State dominates Maryland softball in doubleheader sweep]

The Terps obliged, finishing the contest without an error and salvaging the final game of the series.

The lone error Sunday was on the Penn State defense in the third inning, as shortstop Melina Livingston bobbled second baseman Regan Kerr’s grounder, allowing her to reach first. Kerr then stole second and scored on a single to left-center field from right fielder Shelby Younkin after a Nittany Lions pitching change.

After repeatedly paying for their mistakes Saturday, Maryland was more than pleased to flip the script and capitalize off Penn State’s error Sunday, helping the squad avoid a series sweep as they continue to look for their first Big Ten series win of the season.

“When we come out strong, and we shut them down defensively and get our bats going, [those are] the best games we have,” Kerr said. “So it was really important for us to focus on that.”