Add pep tests
Fix crash