Fixed various other bugs