fix file opening in postfit.py