Fixing up some saving bugs

Also redoing a change that got overwritten regarding Mela_SQL