fixed a break in qpsi
fixed errors in filewriter