Fix compile errors on 0.11

Disclaimer I don't know rust very well yet and I did not try this on 0.10... tests do pass however so I assume things are working mostly correct.