Fix a few issues with bindings, start writing tests for bindings