Fixed some startup bugs