Partial implementation of -keep-records, still some work to do...