Fixed startup bugs (finally)