Added open files, some tidup required.