Fixed Crash and SafeMode issues