Fixed misc bugs, code builds but hasn't been tested on the bot