Save/restore functions

Added fixes for vector item saving and restoring