Changes to fix DB save operations