Fix failing test for syn. sec. (#5902) and clean up a bit