The Madrid outfit won just one of their first seven matches, but returned to form with a 1-0 win over Real Sociedad at the weekend.
"The victory in Saturday's match was important for us. The team was doing well, but if the results are not positive, things are more difficult," Viera told reports at a press conference.
"When you play well and do not win, it seems that all the work you are doing is not coming together. Hopefully this is the start of a good trajectory. Our problem was that we were committing too many mistakes, things unlike us and in the Primera Division that translates into chances and goals against.
"It seems that we have closed that chapter. Already at Valencia [in the previous game] we had committed fewer glitches and it was not a miracle that we managed to win against Real, after not making so many mistakes."
Viera is currently on loan at Rayo from Valencia.