upgrade to 0.9.7

did not cherry-pick because the commits touches many other ports.
git diff --no-prefix
0eeea621dd9cabb58c0520c76c47af096f39b824..e7613df55dd5efc7ad88a38fd8197b146424999f