Partial fixes

Should switch writer to using cursor too, but current .NET wrapper crashes