Correct compilation and fix xlog.c according to spec