Some more cleanups in main.c