Fixed bug when append is used.