Fix various Github issues.
Merge from HEAD.