Fixed errors in main