While cleaning up pinvokes (#2) had stumbled on #1 which needed fixing. Also fixing disposable pattern while I'm here (#3)