Fix a SEGV on the bindings

Make the example save a file