Cleanup permid.py