Now catching malloc errors. Using %05d numbering.