Added tweaked permission modification from @schlamar to handle removing files that are read-only