Safe Mode Patching + Fix for adding the same repository multiple times