Fix the safe mode (see #5490)