fixed k-point handling in writePwi