Fixed writing vector to file a bit, removed unused function