Fixed a bunch of bugs to make the bot work