Fixed some bugs, improoved starting script.