Fixed some bugs overall with the code