Fixing some bugs that prevented saving of objects to redis, and some other subtle side effects