Fixed bugs, added update check function