agent: Fix error from do_encryption.