Fixes to upstream library.