Updated to work on rust-0.6