Cleaned up some errors in main