Correct build error by fprintf and undefined variable removal.