Update code for rust master

The changes are in the commit messages.