Add correct handling of headers in rectanglepubcell
Cleaned up python files