Fixed build error and added debug in main.c