Moved the maximum number of patches into app resources; auto restart when safe mode is toggled