Update typecast_persisted_attributes to not mutate arguments. Remove object argument