Update to compile under latest rust
Fix warnings from latest rustc
Fix unit tests