Fixed an error in main() function.