Fixes bug and compatibility with Rust 0.12