fixed various append related bugs