Fixed a couple bugs in the main driver