Fixed several errors

I fixed some errors that kept the program from functioning normally.