Fixed bug when writing to rejects files