Update code to be compatible with Rust 0.12-dev