Minor fixes to main.c