Made compatible with Rust 0.8. Still a bit ugly, though