Fix rotated file bug and improve tracking of renames; also add fileinfo cleanup