Fixed startup bugs