Make it work with rust 0.8-pre
Minor changes to compile on master.