fixed few vector copying bugs