Code cleanup, call fflush(stdout) after every debug message