Bug fixes

I have fixed an unknown variable name, an incomplete function call and a syntax error.
I have changed the callback definition in the example to use the same data type as in the package.