Small mods to main.c