Fix C errors in apps/main.c