Fixed some funky bugs