Fix removing flags from serialized object before saving it in DB