Fixed the code that maintains the files with a consistent mode (so