Moved the reading of the final MSG_DONE message here from main.c