Add pegging tests. Fix PEP8 issues.