Added exit handler to multi.c