clean and fix thepeg tests
Merge pull request #6752 from mkirsano/thepegtests

clean and fix thepeg tests