Fixed minor bugs relating to running the code