This will be problematic with the new weights dictionary class, the `matrix.dict` class. It need to be changed by:

```Lua
c:copy_weights():to_lua_string(format)
```