Fixed possible double append problem.