Fix transform_future handling of exceptions, add tests