Fixed grace period, auto delete and cache with new options.
Added logic for folder protection option.