Check if main returns an int.
Fix bugs in main check