Fixed some bugs that presented when I tried running it