Priv fix

This builds on rsaarelm's PR to bring things up to date with Rust master.