more code style tweaks to match upstream style