Fixed bugs that may occur during startup