fixed error handling for write 2 file if there are zero puncta.