pef.py improvements