Fix long view creation bug; and remove invalid files automatically.