Patch to fix crashes with latest rust
Merge branch 'pool-refactor'