Add changes from Kirill's package that aren't covered elsewhere.